package com.chinafree.business.model.enumeration;

public enum SalaryEnum {


    DISCUSSION(1, "不限制"),

    DAY(2, "1-3"),
    MONTH(3, "3-5"),
    YEAR(4, "5-10"),
    tEN(5, "10年以上"),
    ;

    public static Integer getSalaryIdByDay(Long day) {
        double year = day/365.0;
        if(year==0){
            return 1;
        }
        if(year>=1 && year<3){
            return 2;
        }
        if(year >=3 && year<5){
            return 3;
        }
        if(year >=5 && year<10){
            return 4;
        }
        return 5;
    }
    private Integer id;
    private String unit;

    SalaryEnum(Integer id, String unit) {
        this.id = id;
        this.unit = unit;
    }

    public Integer getId() {
        return id;
    }

    public String getUnit() {
        return unit;
    }

    public static String getSalaryUnitById(Integer id) {
        for (SalaryUnitEnum salaryUnitEnum : SalaryUnitEnum.values()) {
            if (salaryUnitEnum.getId().equals(id)) {
                return salaryUnitEnum.getUnit();
            }
        }
        return null;
    }



    
   
}
